var app = {
    loginEvent:function () {
        mui('#view').on('tap','#login',function(){
            var username=document.getElementById('username');
            var pwd=document.getElementById('pwd');
            if(!username||!pwd){return}
            $$.showLoading();
            $$.ajax({
                url:Interface.LOGIN,
                data:{
                    phone:username.value.trim(),
                    code:pwd.value.trim()
                },
                success:function(data){
                    if(data.error==0){
                        $$.setStorage('user',data.info);
                        $$.closeLoading();
                        $$.openWin({
                            url:"../index.html",
                            id:"index"
                        });
                    }
                }
            });
        });
    }
};